<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- Sidebar -->
    <div id="sidebar">
    
   
      <!-- Search -->
      <div class="box search">
        <h2>Search by <span></span></h2>
        <div class="box-content">
          <form action="Search.do" method="get">
            <label>Product name</label>
            
            <input type="text" class="field" name="productname" 
                       <c:if test="${requestScope.productname != null}">
                           value ="${requestScope.productname}"
                       </c:if>
                       >
            <label>Category</label>
            <select name="productcatalog" style="width:100%">
                    <option value="-1" selected="selected">--none--</option>
                    <!--Bat Dau Danh Muc-->
                    <c:forEach var="pc" items="${requestScope.listProductCatalog}" >
                        <option 
                            <c:if test="${param.productcatalog != null and param.productcatalog.equals(pc.catalogid.toString())}">
                                    selected='selected'
                            </c:if>
                            value='${pc.catalogid}'> ${pc.catalogname} </option>
                    </c:forEach>
                   
                    <!--Ket Thuc Danh Muc-->
                </select>

            <label for="brand">Brand</label>
				<c:forEach var="br" items="${requestScope.listBrand}">
					<input type="checkbox" value="${br.brandname}" name="brand" 
						<c:forEach var="namebrand" items="${requestScope.listbrand }">
							<c:if test="${br.brandname.equals(namebrand) }">
								checked="checked"
							</c:if>
						</c:forEach> 
					/>${br.brandname} <br />
				</c:forEach>
				<br>
			<label for="condition">Condition</label>
				<c:forEach var="condition" items="${requestScope.listCondition}">
					<input type="checkbox" value="${condition.conditionname}" name="condition"
						<c:forEach var="namecondition" items="${requestScope.listcondition }">
							<c:if test="${condition.conditionname.equals(namecondition) }">
								checked="checked"
							</c:if>
						</c:forEach> 
					 />${condition.conditionname} <br />
				</c:forEach>
				<br>
				<label for="rating">Rating</label>
				<select name = "rating">
					<option value="-1" selected="selected">--none--</option>
					<c:forEach var="i" begin="1" end="5" >	
                        <option 
                            <c:if test="${param.rating != null and param.rating == i}">
                                    selected='selected'
                            </c:if>
                            value='${i }'> Over ${i } star </option>
                    </c:forEach>
				</select>
				<br>
            <label for="price">From Price</label>
                <input type="text"  name="minprice" 
                       <c:if test="${param.minprice != null}">
                           value ="${param.minprice}"
                       </c:if>                   
                       style="width:97%">
                <label for="giaBan">To</label>
                <input type="text"  name="maxprice" 
                       <c:if test="${param.maxprice != null}">
                           value ="${param.maxprice}"
                       </c:if>
                       style="width:97%">
            <input type="submit" class="search-submit" value="Search" name="Search"/>
          </form>
        </div>
      </div>
      <!-- End Search -->

      <!-- Categories -->
      <div class="box categories">
        <h2>Categories <span></span></h2>
        <div class="box-content">
          <ul>
            <c:forEach var="productCatalog" items="${requestScope.listProductCatalog}">
				<li><a href="Products.do?catalogid=${productCatalog.catalogid}">${productCatalog.catalogname}</a></li>
			</c:forEach>
          </ul>
        </div>
        <div id="fb-root"></div>
	<script>(function(d, s, id) {
	  var js, fjs = d.getElementsByTagName(s)[0];
	  if (d.getElementById(id)) return;
	  js = d.createElement(s); js.id = id;
	  js.src = "//connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.0";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>
	<div class="fb-like-box" data-href="https://www.facebook.com/AFCVN?fref=ts" data-width="224" data-colorscheme="light" data-show-faces="true" data-header="true" data-show-border="true"></div>
		<div class="fb-share-button" data-href="https://www.facebook.com/AFCVN?fref=ts" data-layout="button_count"></div>
      </div>
      <!-- End Categories -->
      <a href="ymsgr:sendim?ptxanh2011" mce_href="ymsgr:sendim?ptxanh2011" border="0"><img src="http://opi.yahoo.com/online?u=ptxanh2011&t=14" mce_src="http://opi.yahoo.com/online?u=ptanh2011&t=14"></a>
    </div>
    
    <!-- End Sidebar -->